import httpFetch from 'share/httpFetch'

export default {
  getMenuList(){
    return httpFetch.get(`/api/finance/config/menu/list`)
  },

  getTableList(params){
    return httpFetch.get(`/api/finance/config/list`, params)
  },

  getInitForm(params){
    return httpFetch.get(`/api/finance/config/get/default`, params);
  },

  saveForm(params){
    return httpFetch.post(`/api/finance/config`, params);
  },

  getAssignCompany(params){
    Object.keys(params).map(item => {
      !params[item] && delete params[item];
    });
    return httpFetch.get(`/api/finance/config/query/all/companyRules`, params)
  },

  deleteRule(params) {
    return httpFetch.delete(`/api/finance/config`, params);
  }
}
